<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
<%@taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
<%@page import="ssi.beans.Message"%>
<%    
	Message message= Message.getMessage(Integer.parseInt(request.getParameter("id")));
%>
<script type="text/javascript" src="js/jQuery.js"></script>
<script type="text/javascript" src="js/jquery.nivo.slider.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript" src="js/writeBack.js"></script>
	
			<h2><%=message.getTitle() %></h2>
			<p class="date"> <b>Napisal(a):</b> <%=message.getSender()[0]+" "+message.getSender()[1] %></p><br> 
			
			<p><%=message.getText() %></p>
			<p class="right"><b>Dnia:</b> <%=message.getSentDate() %></p>
			

<br />

	<center><div id="write" class="button">Odpisz</div>
	<a class='more2' href="/SSIProject/index.jsp?page=messages">Wróć do skrzynki</a></center>
	<br>
	
	<div id="writeBack" class="hidden screen">
	<h3>Odpisz</h3>
			<html:form action="sendMessage">
			<input type="hidden" id="receiverId" name="receiverId" value=<%=message.getSenderId() %> />
			<table>
			<tr>
			<td>Temat:</td><td><input type="text" name="title" id="title" /></td>
			</tr>
			<tr>
			<td>Tekst:</td><td> <textarea name="text" id="text" rows="9" cols="40"></textarea></td>
			</tr>
			</table>
			<input type="submit" class="submit" value="Wyslij" />
			</html:form>
		</div>
